$OpenBSD: patch-unifi_sh_api,v 1.3 2017/06/02 16:12:38 sthen Exp $
Index: unifi_sh_api
--- unifi_sh_api.orig
+++ unifi_sh_api
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/ksh
 
 #username=ubnt
 #password=ubnt
@@ -53,7 +53,7 @@ unifi_api() {
     fi
     uri=$1
     shift
-    [ "${uri:0:1}" != "/" ] && uri="/$uri"
+    [ $(echo $uri | cut -c1) != "/" ] && uri="/$uri"
     json="$@"
     [ "$json" = "" ] && json="{}"
     ${curl_cmd} --data "$json" $baseurl/api/s/$site$uri
